Add a --quiet option.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 1 Feb 2005 13:55:08 +0000 (13:55 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 1 Feb 2005 13:55:08 +0000 (13:55 +0000)
2005-02-01  Matthias Clasen  <mclasen@redhat.com>

* gtk/updateiconcache.c (main): Add a --quiet option.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/gtk/gtk-update-icon-cache.1
docs/reference/gtk/gtk-update-icon-cache.xml
gtk/updateiconcache.c

index 7cd4312a5ba1de385f870743d8a6f211a853e5e3..4a9b2ecee98862d2762f891f3df1d49f0fb6b0b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/updateiconcache.c (main): Add a --quiet option.
+
 2005-02-01  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkkeys-win32.c (handle_special, set_shift_vks,
index 7cd4312a5ba1de385f870743d8a6f211a853e5e3..4a9b2ecee98862d2762f891f3df1d49f0fb6b0b7 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/updateiconcache.c (main): Add a --quiet option.
+
 2005-02-01  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkkeys-win32.c (handle_special, set_shift_vks,
index 7cd4312a5ba1de385f870743d8a6f211a853e5e3..4a9b2ecee98862d2762f891f3df1d49f0fb6b0b7 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/updateiconcache.c (main): Add a --quiet option.
+
 2005-02-01  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkkeys-win32.c (handle_special, set_shift_vks,
index c0eb467c7c1b3bebabac2001351bc695e0d5c7be..4e2b45601ed71f2ef407777beb47f410ffb72585 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk-update-icon-cache.xml:
+       * gtk/gtk-update-icon-cache.1: Document the --quiet option.
+
 2005-01-25  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/tmpl/gtksocket.sgml:
index b53c02d133c4ab61d6772685d39a194507dc59cd..c9c2ca03b8c1d92d89cbde3dba597cabce967433 100644 (file)
@@ -24,7 +24,7 @@ gtk-update-icon-cache \- Icon theme caching utility
 .ad l
 .hy 0
 .HP 22
-\fBgtk\-update\-icon\-cache\fR [\-\-force] {iconpath}
+\fBgtk\-update\-icon\-cache\fR [\-\-force] [\-\-quiet] {iconpath}
 .ad
 .hy
 
@@ -39,8 +39,15 @@ If expects to be given the path to a icon theme directory, e\&.g\&. \fI/usr/shar
 .PP
 GTK+ can use the cache files created by \fBgtk\-update\-icon\-cache\fR to avoid a lot of system call and disk seek overhead when the application starts\&. Since the format of the cache files allows them to be mmap()ed shared between multiple applications, the overall memory consumption is reduced as well\&.
 
-.PP
-If called with the \-\-force argument, \fBgtk\-update\-icon\-cache\fR will overwrite an existing cache file even if it appears to be uptodate\&.
+.SH "OPTIONS"
+
+.TP
+\-\-force, \-f
+Overwrite an existing cache file even if it appears to be uptodate\&.
+
+.TP
+\-\-quiet, \-q
+Turn off verbose output\&.
 
 .SH "BUGS"
 
index e7baad89d5514e05eeea6969403a55f43567f1ed..40a847f4c7872629a6fad7c632618ad20ed38d8a 100644 (file)
@@ -14,6 +14,7 @@
 <cmdsynopsis>
 <command>gtk-update-icon-cache</command>
 <arg choice="opt">--force</arg>
+<arg choice="opt">--quiet</arg>
 <arg choice="req">iconpath</arg>
 </cmdsynopsis>
 </refsynopsisdiv>
@@ -35,11 +36,23 @@ to avoid a lot of system call and disk seek overhead when the application starts
 Since the format of the cache files allows them to be mmap()ed shared between
 multiple applications, the overall memory consumption is reduced as well.
 </para>
-<para>
-If called with the --force argument, 
-<command>gtk-update-icon-cache</command> will overwrite an existing cache
-file even if it appears to be uptodate.
-</para>
+</refsect1>
+
+<refsect1><title>Options</title>
+<variablelist>
+  <varlistentry>
+    <term>--force</term>
+    <term>-f</term>
+    <listitem><para>Overwrite an existing cache file even if it appears to be uptodate.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term>--quiet</term>
+    <term>-q</term>
+    <listitem><para>Turn off verbose output. 
+    </para></listitem>
+  </varlistentry>
+</variablelist>
 </refsect1>
 
 <refsect1><title>Bugs</title>
index 5231a064b61cea39751fbc565e37ea07f388e60f..cdf6afa5bcb4a17ac44e21ee0cf5c7504147fbf3 100644 (file)
@@ -29,6 +29,9 @@
 #include <glib.h>
 #include <glib/gstdio.h>
 
+static gboolean force_update = FALSE;
+static gboolean quiet = FALSE;
+
 #define CACHE_NAME "icon-theme.cache"
 
 #define HAS_SUFFIX_XPM (1 << 0)
@@ -606,13 +609,13 @@ build_cache (const gchar *path)
   utime_buf.modtime = cache_stat.st_mtime;
   utime (path, &utime_buf);
   
-  g_printerr ("Cache file created successfully.\n");
+  if (!quiet)
+    g_printerr ("Cache file created successfully.\n");
 }
 
-static gboolean force_update = FALSE;
-
 static GOptionEntry args[] = {
-  { "force", 0, 0, G_OPTION_ARG_NONE, &force_update, "Overwrite an existing cache, even if uptodate", NULL },
+  { "force", 'f', 0, G_OPTION_ARG_NONE, &force_update, "Overwrite an existing cache, even if uptodate", NULL },
+  { "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Turn off verbose output", NULL },
   { NULL }
 };